<?php
// check-curl.php
echo "检查cURL支持:<br>";
if (function_exists('curl_version')) {
    $curl_info = curl_version();
    echo "cURL支持: 是<br>";
    echo "cURL版本: " . $curl_info['version'] . "<br>";
    echo "SSL支持: " . ($curl_info['features'] & CURL_VERSION_SSL ? "是" : "否") . "<br>";
} else {
    echo "cURL支持: 否<br>";
}

echo "<br>测试网络连接:<br>";
$test_url = 'https://dashscope.aliyuncs.com';
$ch = curl_init($test_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "连接测试: HTTP " . $http_code . "<br>";
if ($http_code === 200 || $http_code === 403) {
    echo "网络连接: 正常<br>";
} else {
    echo "网络连接: 失败<br>";
}
?>